/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.ManagerEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

public interface ManagerEntityMapper {
    /* @mbggenerated */
    @Delete({
        "delete from manager_entity",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into manager_entity (id, entity_name, ",
        "url_id, state, create_user, ",
        "create_time, upd_user, ",
        "update_time, entity_key)",
        "values (#{id,jdbcType=INTEGER}, #{entityName,jdbcType=VARCHAR}, ",
        "#{urlId,jdbcType=INTEGER}, #{state,jdbcType=TINYINT}, #{createUser,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updUser,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{entityKey,jdbcType=VARCHAR})"
    })
    int insert(ManagerEntity record);

    /* @mbggenerated */
    @InsertProvider(type=ManagerEntitySqlProvider.class, method="insertSelective")
    int insertSelective(ManagerEntity record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, entity_name, url_id, state, create_user, create_time, upd_user, update_time, ",
        "entity_key",
        "from manager_entity",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="entity_name", property="entityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="url_id", property="urlId", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_user", property="createUser", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="upd_user", property="updUser", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="entity_key", property="entityKey", jdbcType=JdbcType.VARCHAR)
    })
    ManagerEntity selectByPrimaryKey(Integer id);

    /* @mbggenerated */
    @UpdateProvider(type=ManagerEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ManagerEntity record);

    /* @mbggenerated */
    @Update({
        "update manager_entity",
        "set entity_name = #{entityName,jdbcType=VARCHAR},",
          "url_id = #{urlId,jdbcType=INTEGER},",
          "state = #{state,jdbcType=TINYINT},",
          "create_user = #{createUser,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "upd_user = #{updUser,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "entity_key = #{entityKey,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ManagerEntity record);
}